package nc.ui.cmp.applaybill.command;

import nc.ui.cmp.applaybill.ClientUI;
import nc.ui.cmp.applaybill.common.UIUtil;
import nc.ui.pub.ButtonObject;
import nc.ui.trade.base.IBillOperate;
import nc.ui.trade.bocommand.IButtonCommand;
import nc.ui.trade.controller.IControllerBase;
import nc.ui.trade.manage.BillManageUI;
import nc.ui.trade.manage.ManageEventHandler;
import nc.vo.cmp.applaybill.ApplyBillVO;

public class CancelBoCommand extends ManageEventHandler implements IButtonCommand {

	public CancelBoCommand(BillManageUI billUI, IControllerBase control) {
		super(billUI, control);
		// TODO Auto-generated constructor stub
	}

	public void execute(ButtonObject bo) throws Exception {
		ClientUI clientUI = (ClientUI)getBillUI();
		clientUI.getBillCardWrapper().setCardData(clientUI.getUiContext().getClone());
		clientUI.getBillCardPanel().setEnabled(false);
		clientUI.getUiContext().setBillType(null);
		if(clientUI.getUiContext().getClone() != null) {
			UIUtil.updateButtonsByBean((ApplyBillVO) clientUI.getUiContext().getClone().getParentVO(), clientUI);
		}else {
			clientUI.setBillOperate(IBillOperate.OP_INIT);
		}
//		super.onBoCancel();
	}

}
